import { ChatOpenAI, ChatOpenAIFields } from '@langchain/openai';

export const getOpenaiInstance = (fields?: ChatOpenAIFields) =>
  new ChatOpenAI({
    model: process.env.OPENAI_MODEL || 'qwen-plus',
    // configuration: {
    //   baseURL: 'https://dashscope.aliyuncs.com/compatible-mode/v1',
    //   apiKey: '890514f1113a45e5b657b202652e9b5d',
    // },
    temperature: 0,
    ...fields,
  });
